Some fixes to the performance counters code.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 30 Aug 2005 17:00:26 +0000 (17:00 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 30 Aug 2005 17:00:26 +0000 (17:00 +0000)
Signed-off-by: Ross McIlroy <mcilrorc@dcs.gla.ac.uk>
tools/misc/cpuperf/cpuperf.c
xen/include/xen/perfc.h

index 093cde556d43d6397873e361fddc8051c769394a..999c04891a60adf11cca30a52bc415835a99ca14 100644 (file)
@@ -243,16 +243,12 @@ int main(int argc, char **argv)
     }
 
     if (read) {
-        while((cpu_mask&1)) {
-            int i;
-            for (i=0x300;i<0x312;i++) {
-                printf("%010llu ",cpus_rdmsr( cpu_mask, i ) );
-            }
-            printf("\n");
-            cpu_mask>>=1;
-        }
+        int i;
+        for (i=0x300;i<0x312;i++)
+            printf("%010llu ",cpus_rdmsr( cpu_mask, i ) );
+        printf("\n");
         exit(1);
-    } 
+    }
     
     if (!escr) {
         fprintf(stderr, "Need an ESCR.\n");
index 48c7e90fb4cbcf18fdb588b1dd1fd05bc55b31cd..e2c9bdd2e8eb62f5f31068eb763873d87c5dc088 100644 (file)
@@ -4,6 +4,7 @@
 
 #ifdef PERF_COUNTERS
 
+#include <xen/lib.h>
 #include <asm/atomic.h>
 
 /* 
@@ -87,7 +88,7 @@ extern struct perfcounter perfcounters;
  * Histogram: special treatment for 0 and 1 count. After that equally spaced 
  * with last bucket taking the rest.
  */
-#ifdef PERFC_ARRAYS
+#ifdef PERF_ARRAYS
 #define perfc_incr_histo(_x,_v,_n)                                          \
     do {                                                                    \
         if ( (_v) == 0 )                                                    \